﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using jQM;

namespace Project_jQMvc.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            List<BasicLinkedListItem> navList = new List<BasicLinkedListItem>();
            navList.Add(new BasicLinkedListItem("Unordered list", "/Home/UnorderedList"));
            navList.Add(new BasicLinkedListItem("Unordered list with search", "/Home/UnorderedListWithSearch"));
            navList.Add(new BasicLinkedListItem("Buttons", "/Home/Buttons"));

            return View(navList);
        }

        public ActionResult UnorderedList()
        {
            return View(generateList(10));
        }

        public ActionResult UnorderedListWithSearch()
        {
            return View(generateList(100));
        }

        public ActionResult Buttons()
        {
            return View();
        }

        private List<BasicListItem> generateList(int count)
        {
            List<BasicListItem> list = new List<BasicListItem>();
            for (int i = 0; i < count; i++)
            {
                list.Add(new BasicListItem("Hi. I am list item " + i + "."));
            }

            return list;
        }
    }
}
